import axios from "./index";
import {LoginForm} from "@/api/type";

/**
 * 获取 当前系统的clientId
 */
export function getClientId() {
    return axios.get('/api/github/clientId')
}

/**
 * 根据github callback code 获取github userInfo
 * @param code
 */
export function getTokenByCode(code: string) {
    return axios.post('/api/github/getToken', {code})
}

/**
 * 登录接口
 * @param params
 */
export function login(params: LoginForm) {
    return axios.get('/api/user/login', {
        params
    })
}